home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / dot_alien_scripts.lua < prev    next >
Encoding:
Text File  |  2004-11-22  |  4.2 KB  |  127 lines

  1.  
  2. function units_dot_alien_setup()
  3.     units_setup(4,true,ENET_EFFECT_PS_SETUPSMOKE_SMALL,ENET_EFFECT_GEOMETRY_DOTALIENSHADOW)
  4. end
  5.  
  6. function units_dot_alien_resetup()
  7.     units_setup(4,true,nil,ENET_EFFECT_GEOMETRY_DOTALIENSHADOW)
  8. end
  9.  
  10. function units_dot_alien_select()
  11.     units_select(12,2)
  12. end
  13.  
  14. function units_dot_alien_unselect()
  15.     units_unselect()
  16. end
  17.  
  18. function units_dot_alien_selectenemy()
  19.     uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
  20. end
  21.  
  22. function units_dot_alien_damaged()
  23.     uniGetExecutor():applyDamage(uniGetLife())
  24. end
  25.  
  26. function units_dot_alien_highlight()
  27.     uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
  28. end
  29.  
  30. function units_dot_alien_explode()
  31.     units_explode_small1_green()
  32. end
  33.  
  34. function units_dot_alien_fire()
  35.     uniSetLife(uniGetLife() / 6)
  36.     local unit = uniGetExecutor()
  37.     local gt = unit:getBone(ENBT_GUNTOWER)
  38.     local sound = gt:play3DSound("dot_a_rotate.wav",1)
  39.     waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
  40.     waitDeath(gt:getBone(ENBT_GUN):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI,uniGetTarget()))
  41.     sound:stopSound()
  42.     local firespots = {}
  43.     firespots[0] = gt:getBone(ENBT_FIRE1,0)
  44.     firespots[1] = gt:getBone(ENBT_FIRE1,1)
  45.  
  46.     waitDeath(gt:aimGun(0,MATH_PI / 3.0,uniGetTarget()))
  47.     local i = 0
  48.     
  49.     gt:play3DSound("dot_a_fire.wav",0):destroy()
  50.     for i = 0,2 do
  51.         local shot1 = firespots[0]:addSimpleEffect(ENET_EFFECT_DOTALIENSHOT_FLY):executeCommand(ENC_FIRE1)
  52.         local shot2 = firespots[0]:addBulletEffect(ENET_EFFECT_PS_DOTALIENSHOT)
  53.         gt:gunRecoil(0,0.15,6)
  54.         pause(0.1)
  55.         local shot1_2 = firespots[1]:addSimpleEffect(ENET_EFFECT_DOTALIENSHOT_FLY):executeCommand(ENC_FIRE1)
  56.         local shot2_2 = firespots[1]:addBulletEffect(ENET_EFFECT_PS_DOTALIENSHOT)
  57.         gt:gunRecoil(1,0.15,6)
  58.         pause(0.1)
  59.         shot2:suspendedDestroy(1.5)
  60.         shot2_2:suspendedDestroy(1.5)
  61.     end
  62.  
  63.     unit:addFireArrow()
  64. end
  65.  
  66. function units_dot_alien_move()
  67. end
  68.  
  69. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_MOVE,"units_dot_alien_move")
  70. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_FIRE1,"units_dot_alien_fire")
  71. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_FIRE2,"units_dot_alien_fire")
  72. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_SELECT,"units_dot_alien_select")
  73. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_SELECTENEMY,"units_dot_alien_selectenemy")
  74. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_UNSELECT,"units_dot_alien_unselect")
  75. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_SETUP,"units_dot_alien_setup")
  76. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_RESETUP,"units_dot_alien_resetup")
  77. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_DAMAGED,"units_dot_alien_damaged")
  78. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_EXPLODE,"units_dot_alien_explode")
  79. registerCommand(ENSCRIPTSET_DOT_ALIEN,ENC_HIGHLIGHT,"units_dot_alien_highlight")
  80.  
  81. -- make description of unit
  82. desc = getEffectDescriptionP(ENET_UNIT_DOT_ALIEN)
  83. desc.ClassID = ENCLASS_MESHINSTANCE
  84. desc.EffectClassType = ENECT_GEOMETRY
  85. desc.FileName = "dot_alien.rmd"
  86. desc.ScriptSet = ENSCRIPTSET_DOT_ALIEN
  87. desc.MoveType = ENMOVE_NOTALLOWED
  88. desc.RenderType = ENRENDERTYPE_GEOMETRY
  89. desc.Material = ENMAT_RIGIDSKINNEDMESH
  90. desc.MaterialColors = units_materialcolors_human
  91.  
  92. -- shadow
  93. desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_DOTALIENSHADOW)
  94. desc.ClassID = ENCLASS_MESHINSTANCE
  95. desc.EffectClassType = ENECT_GEOMETRY
  96. desc.FileName = "dot_alien_shadow.rmd"
  97. desc.RenderType = ENRENDERTYPE_SHADOW
  98. desc.Material = ENMAT_SHADOW
  99. desc.MaterialColors = units_materialcolors_shadow
  100.  
  101. -- register new unit to logic
  102. unitDesc = logic_getUnitDescP(28)
  103. unitDesc.group = 2
  104. unitDesc.order = 0
  105. unitDesc.unit_res_id = ENET_UNIT_DOT_ALIEN
  106. unitDesc.unit_icon_id = "Dot_a_small_normal.dds"
  107. unitDesc.active_id = "Dot_a_small_active.dds"
  108. unitDesc.pressed_id = "Dot_a_small_pressed.dds"
  109. unitDesc.small_icon_id = "Dot_l_stats.dds"
  110. unitDesc.big_icon_id = "Dot_a_big_normal.dds"
  111. unitDesc.HP = 4
  112. unitDesc.MP = 0
  113. unitDesc.WR = 2
  114. unitDesc.min_WR = 1
  115. unitDesc.WD = 1
  116. unitDesc.WR2 = 0
  117. unitDesc.min_WR2 = 0
  118. unitDesc.WD2 = 0
  119. unitDesc.ability = 1
  120. unitDesc.transport = 0
  121. unitDesc.value = 1
  122. unitDesc.race = 1
  123. unitDesc.fire_pause = 0.6
  124. unitDesc.move_pause = 0.5
  125. unitDesc.unit_info_scale = 0.07
  126. unitDesc.scn_name = "BUNKER"
  127.